<?php
class Lion_View_Helper_OurServices extends Zend_Controller_Action_Helper_Abstract
{
        private $_view;
    public function setView($view) {
            $this->_view = $view;
    }

    public function OurServices()
    {  
        require_once '../application/default/models/Specialtext.php';
    	$model_specialtext = new Specialtext();
    	$specialtext_arr = $model_specialtext->getSpecialtextDetails();
        
        ?>
        <ul>
        <?php
        foreach ($specialtext_arr as $key => $val) {
            $submenuclass='';
            $submenu_arr=$model_specialtext->getSpecialtextDetails($val['id']);            
            if(!empty($submenu_arr)){
                $submenuclass=" submenuheader ";
            }

            if($val['title'] == "Excursions")
            {
                $sp_link1 = "/excursion/view/";
            } else if($val['title'] == "Tours") {
                $sp_link1 = "/tour/view/";
            } else {
                $sp_link1 = "/specialtext/view/st_id/" . $val['id'];
            }
        ?>
            <li><a class="menuitem <?php echo $submenuclass; ?>" href="<?php echo $sp_link1; ?>"><?php echo $this->_view->translate('%'.$val['title'], 'home'); ?></a></li>
            <?php            
            if(!empty($submenu_arr)){?>
            <div class="submenu">
                <ul>
            <?php            
            foreach ($submenu_arr as $key1 => $val1) {
                if($val1['title'] == "Maldives") {
                    $sp_link2 = "/destinations/view/cid/2";
                } else if($val1['title'] == "Sri Lanka") {
                    $sp_link2 = "/destinations/view/cid/1";
                } else {
                    $sp_link2 = "/specialtext/view/st_id/" . $val1['id'];
                }
            ?>
                    <li ><a href="<?php echo $sp_link2; ?>"><?php echo $val1['title']; ?></a></li>
            <?php
            }?>
                </ul>
            </div>
            <?php } ?>
        <?php } ?>
        </ul>
        <?php
    }
}		
?>
